<template>
  <div>
    <el-table
        :data="pageData" stripe style="width: 100%"
        :header-cell-style="{
                'text-align':'center',
                'background-color':'#F0FFF0'
              }"
        :cell-style="{'text-align':'center'}">
      <el-table-column prop="id" label="序号"></el-table-column>
      <el-table-column prop="number" label="盘点单号"/>
      <el-table-column prop="createTime" label="盘点日期"/>
      <el-table-column prop="employee" label="制单人"/>
      <el-table-column prop="checkSheetStatus" label="盘点状态">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.audit_status" :value="scope.row.checkSheetStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="150">
        <template slot-scope="scope">
          <el-link type="primary"
                   :underline="false"
                   v-if="scope.row.checkSheetStatus=== 1"
                   @click="lookCheckDetailOnFinish(scope.row.id)"
                   class="margin-right">查看
           <!--            '盘点完成'-->
          </el-link>
          <el-link type="primary"
                   :underline="false"
                   v-if="scope.row.checkSheetStatus=== 2"
                   @click="lookCheckDetailOnCurrent(scope.row.id)"
                   class="margin-right">查看
          </el-link>
          <el-link type="primary"
                   :underline="false"
                   v-if="scope.row.checkSheetStatus=== 2"
                   @click="deleteCheck"
                   class="margin-right">删除
          </el-link>
        </template>
      </el-table-column>
    </el-table>
    <sn-page
        :table-data="tableData"
        class="float-right margin-top-20 margin-bottom-20"
        @getPageData="getPageData"/>
  </div>
</template>

<script>
export default {
  name: "DrugChangePriceTable",
  dicts: ['sys_normal_disable','specification','drug_type','prescription_type','factory','drug_status','audit_status'],
  data() {
    return {
      //每页数据
      pageData: [],
    }
  },
  props: {
    //数据
    tableData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    getPageData(pageData) {
      this.pageData = pageData
    },
    deleteCheck() {

    },
    //查看盘点完成的信息
    lookCheckDetailOnFinish() {
      this.$router.push({ path: "/yldrug/stocktaking/stocktakingDetails"  }).catch(()=>{});
    },
    //查看正在盘点的信息
    lookCheckDetailOnCurrent(id) {
      this.$router.push({ path: "/yldrug/stocktaking/addStocktaking/"+id  }).catch(()=>{});
      // this.$router.push("/drugManageRoot/stockCheckCurrent/" + id)
    }
  },

}
</script>

<style scoped>
</style>
